package com.japp.manager.service;

import java.io.Serializable;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.japp.base.BaseService;
import com.japp.manager.bean.SummaryBean;
import com.japp.manager.mapper.SummaryMapper;
import com.japp.tools.common.JappLog;
import com.japp.tools.page.Page;

/**
 * 研究报告
 * @author Administrator
 *
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SummaryService implements BaseService{
	@Autowired
	private SummaryMapper summaryMapper;
	
	public SummaryBean get(Serializable pk) {
		return null;
	}

	
	public Page<SummaryBean> getPage(Page<SummaryBean> po, SummaryBean obj) {
		try {
			Page<SummaryBean> page = summaryMapper.getPage(po, obj);
			return page;
		} catch (Exception e) {
			JappLog.log.error("",e);
		}
		return null;
	}

	
	public List<SummaryBean> querySummaryAll() {
		try {
			return summaryMapper.querySummaryAll();
		} catch (Exception e) {
			JappLog.log.error("",e);
		}
		return null;
	}
	
	public SummaryBean findSummaryById(int summaryId) {
		try {
			return summaryMapper.findSummaryById(summaryId);
		} catch (Exception e) {
			JappLog.log.error("",e);
		}
		return null;
	}

	
	public int insertSummary(SummaryBean summary) {
		try {
			return summaryMapper.insertSummary(summary);
		} catch (Exception e) {
			JappLog.log.error("",e);
		}
		return 0;
	}
	public int deleteSummary(String[] keys) {
		try {
			int rel = summaryMapper.deleteSummary(keys);
			return rel;
		} catch (Exception e) {
			JappLog.log.error("",e);
		}
		return 0;
	}

	
	public int updateSummary(SummaryBean summary) {
		try {
			return summaryMapper.updateSummary(summary);
		} catch (Exception e) {
			JappLog.log.error("",e);
		}
		return 0;
	}

}
